home *** CD-ROM | disk | FTP | other *** search
/ Die Ultimative Software-P…i Collection 1996 & 1997 / Die Ultimative Software-Pakete CD-ROM fur Atari Collection 1996 & 1997.iso / p / pov / povlisti.ngs / truchet5.pov < prev    next >
Encoding:
Text File  |  1992-03-11  |  4.4 KB  |  152 lines

  1. // Persistence of Vision Raytracer Version 1.0
  2. #include "colors.inc"
  3. #include "shapes.inc"
  4. #include "textures.inc"
  5.  
  6. camera {
  7.     location <15 50 -60>
  8.     direction <0 0 4>
  9.     up  <0 1 0>
  10.     right <1.33333 0 0>
  11.     look_at <0 1 0>
  12. }
  13.  
  14. object {
  15.    light_source { <5 50 -50>
  16.    colour red 0.85 green 0.85 blue 0.85
  17.    spotlight
  18.    point_at <0 0 0>
  19.    tightness 60
  20.    radius 8
  21.    falloff 16
  22.     }
  23. }
  24. object {
  25.    light_source { <5 100 150>
  26.    colour red 0.4 green 0.4 blue 0.4
  27.    spotlight
  28.    point_at <0 0 0>
  29.    tightness 60
  30.    radius 8
  31.    falloff 16
  32.     }
  33. }
  34.  
  35.  
  36.  
  37. //  Outer radius: 1.25  Inner radius: 0.75
  38. #declare Torus = quartic {
  39.    <    1.000000 0.000000 0.000000 0.000000 2.000000
  40.         0.000000 0.000000 2.000000 0.000000 -2.125000
  41.         0.000000 0.000000 0.000000 0.000000 0.000000
  42.         0.000000 0.000000 0.000000 0.000000 0.000000
  43.         1.000000 0.000000 0.000000 2.000000 0.000000
  44.         1.875000 0.000000 0.000000 0.000000 0.000000
  45.         1.000000 0.000000 -2.125000 0.000000 0.878906 >
  46.  }/* end_quartic */
  47.  
  48. // This really should be just a CSG, with no texture at this point, but
  49. // a current limitation in the parser won't allow me to CLIP without
  50. // declaring the piece as an object.  I could've used an intersection
  51. // instead, but with much more overhead, too.
  52. #declare Quarter_Torus = object {
  53.   quartic { Torus rotate <90 0 0>  }
  54.   clipped_by {
  55.       plane { <-1 0 0> 0  }
  56.       plane { <0  1 0> 0  }
  57.    }
  58.   color Red
  59.   texture {
  60.     Gold_Texture
  61.    }
  62. }
  63.  
  64.  
  65. // A tile is a square space with opposing corners having symmetrical patterns
  66. // so the patterns will still match up when rotated 90 degrees.
  67.  
  68. #declare Tile = composite {
  69.     object { Quarter_Torus translate <-1 1 0>  }/* end_object */
  70.     object { Quarter_Torus rotate <0 0 180> translate <1 -1 0>  }/* end_object */
  71.     bounded_by {
  72.         sphere { <0 0 0> 1.77  }
  73.      }
  74. }
  75. // A special code generator that I wrote "flips" the tiles by 90 degrees
  76. // based on a random "coinflip".  To keep things clearer,  I've designed
  77. // each attitude as a separate tile piece.
  78. #declare EvenTile = composite {
  79.     composite { Tile  }
  80. }
  81. #declare OddTile = composite {
  82.     composite { Tile  }
  83.     rotate <0 0 90>
  84. }
  85.  
  86. // read in the file holding the truchet tile grid data
  87. #include "tile.inc"
  88.  
  89.  
  90. // Build a Chrome_Texture frame.  Four separate pieces are used so that each
  91. // can have a slightly different pattern to the woodgrain.
  92. #declare XFramePiece1 = object { box { UnitBox scale <6.5 0.5 0.5> }
  93.     texture { Chrome_Texture rotate <0 -85 0> translate <-3 0 0> }
  94. }
  95. #declare XFramePiece2 = object { box { UnitBox scale <6.5 0.5 0.5> }
  96.     texture { Chrome_Texture  rotate <0 90 0> translate <-2.5 0 0> }
  97. }
  98. #declare YFramePiece1 = object { box { UnitBox scale <0.5 6.5 0.5> }
  99.     texture { Chrome_Texture  rotate <0 0 0> translate <85 0 1> }
  100. }
  101. #declare YFramePiece2 = object { box { UnitBox scale <0.5 6.5 0.5> }
  102.     texture { Chrome_Texture  rotate <0 5 0> translate <87 0 -1>}
  103. }
  104.  
  105. // Threaded rod,  4 will be used to hold the frame together at the corners
  106. #declare Rod = object {
  107.     intersection {Z_Disk scale <0.25 0.25 7> }
  108.     texture { Chrome_Texture
  109.         gradient <0 0 1>                        // threads
  110.         color_map {
  111.             [0.0 0.5 color DimGray color LightGray ]
  112.             [0.5 1.0 color LightGray color DimGray ]
  113.         }
  114.         scale <1 1 0.1>
  115.         rotate <0 1 0>                          // pitch the threads a bit
  116.     }
  117. }
  118.  
  119. // This is one complete unit which will be repeated four times below.
  120. #declare Piece = composite {
  121.     composite { Tiles }
  122.     object {XFramePiece1 translate <0.5 -6.5 0> }
  123.     object {YFramePiece1 rotate <0 0 180> translate <-6.5 -0.5 0> }
  124.     object {XFramePiece2 rotate <0 0 180> translate <-0.5  6.5 0> }
  125.     object {YFramePiece2 translate < 6.5 0.5 0> }
  126. }
  127.  
  128.  
  129. // Build the finished piece.  3 copies of the framed object are stacked
  130. // along the Z axis, and are tied together with steel rods in each of the
  131. // four corners.
  132. composite {
  133.     composite {Piece}
  134.     composite {Piece rotate <0 0 180> translate <0 0 6> }
  135.     composite {Piece rotate <0 0 90> translate <0 0 -6> }
  136.  
  137.  
  138.     object { Rod  translate <-6.5  6.5 0> }
  139.     object { Rod  translate <-6.5 -6.5 0> }
  140.     object { Rod  translate < 6.5 -6.5 0> }
  141.     object { Rod  translate < 6.5  6.5 0> }
  142. }
  143.  
  144. // A floor plane
  145. object {
  146.     plane { <0 1 0> -7 }
  147.     texture {
  148.         color LightGray
  149.         reflection 0.25
  150.     }
  151. }
  152.